Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StreamResponse and Response implement MutableMapping interface #2494

Merged
merged 11 commits into from
Nov 24, 2017

Conversation

argaen
Copy link
Member

@argaen argaen commented Nov 9, 2017

What do these changes do?

StreamResponse and Response are not MutableMappings

Are there changes in behavior for the user?

Now users can store data in the response object like response['data'] = whatever

Related issue number

#2246

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bug)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@codecov-io
Copy link

codecov-io commented Nov 9, 2017

Codecov Report

Merging #2494 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2494      +/-   ##
==========================================
+ Coverage   97.08%   97.09%   +<.01%     
==========================================
  Files          40       40              
  Lines        8141     8153      +12     
  Branches     1439     1439              
==========================================
+ Hits         7904     7916      +12     
  Misses        100      100              
  Partials      137      137
Impacted Files Coverage Δ
aiohttp/web_response.py 98.25% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67eb1e7...9bd12b3. Read the comment docs.


_length_check = True

def __init__(self, *, status=200, reason=None, headers=None):
def __init__(self, *, status=200, reason=None, headers=None, state=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop state from accepted parameters.
Otherwise you should support it in all derived response classes like web.Response.
I think the second is pointless and don't worth a new param,

@asvetlov
Copy link
Member

@argaen ping

@argaen
Copy link
Member Author

argaen commented Nov 20, 2017

Oops, will submit changes today :)

@argaen
Copy link
Member Author

argaen commented Nov 20, 2017

updated

@asvetlov
Copy link
Member

Please add a couple sentences to web_reference.rst like we already have for Application: https://docs.aiohttp.org/en/latest/web_reference.html#application (Application is a dict-like object, ....)

@argaen
Copy link
Member Author

argaen commented Nov 23, 2017

Added, copied what was describe for Request object

@asvetlov asvetlov merged commit 84825da into aio-libs:master Nov 24, 2017
@asvetlov
Copy link
Member

Thanks!

@lock
Copy link

lock bot commented Oct 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants